// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import axios from 'axios';
import 'element-ui/lib/theme-chalk/index.css'
// import echarts from 'echarts';
import ddapi from "./auth/ddapi.js"

//解决单击300ms的问题
import FastClick from 'fastclick'
FastClick.attach(document.body);

Vue.prototype.$ddapi = ddapi;
// Vue.prototype.echarts=echarts;


Vue.config.productionTip = false
Vue.prototype.$http = axios;
Vue.use(ElementUI)

axios.interceptors.request.use(function (config) { // 这里的config包含每次请求的内容
  config.headers.Authorization = localStorage.getItem('authorization');
  return config;
}, function (err) {
  return Promise.reject(err);
});
Vue.filter("formateFloat", function (value) {
  if(value == '-'){
    return value ;
  }
  return Number(value).toFixed(2);
});


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})
